# return indices of the two numbers such that they add up to the target
# @author: timlentse(tinglenxan@gmail.com)
# @Date: 2014-11-15
#! /usr/bin/python
class Solution:
    # @return a tuple, (index1, index2)
    def twoSum(self, num, target):
        hashMap = {}
        indexs = ();
        for i in xrange(len(num)):
            if (target-num[i]) in hashMap:
               indexs = (hashMap[target-num[i]],i+1)
               break
            else:
              hashMap[num[i]] = i+1
        return indexs

d = Solution()
num = [1,3,4,5,6,7]
target = 7
indexs=d.twoSum(num,target)
print indexs